﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BI.CF.Model;
using BI.CF.BLL;
using System.Data;

namespace BackStage
{
    public partial class UpdateDo : System.Web.UI.Page
    {
        PublishTypeModel model = new PublishTypeModel();
        BulletinBLL bll = new BulletinBLL();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int id =Convert.ToInt32(Request.QueryString["id"]);
                ViewState["id"] = id;
                model= bll.fantian(id);
                TextBox1.Text = model.TID.ToString();
                TextBox2.Text = model.PT_Name;
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            PublishTypeModel modelUpdate = new PublishTypeModel();
            modelUpdate.PT_Name = TextBox2.Text;
            modelUpdate.TID =Convert.ToInt32(ViewState["id"]);
            if (bll.PublishTypeUpdate(modelUpdate)==true)
            {
                Response.Write("<script>alert('更新成功')</script>");
            }
        }
    }
}